package logic

import (
	"context"

	"worker/sse/internal/svc"
	"worker/sse/internal/types"

	"github.com/zeromicro/go-zero/core/logx"
)

type GetUidByGroupLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

func NewGetUidByGroupLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUidByGroupLogic {
	return &GetUidByGroupLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *GetUidByGroupLogic) GetUidByGroup(req *types.GetUidByGroupReq) (resp *types.GetUidByGroupResp, err error) {
	resp = &types.GetUidByGroupResp{
		Uids: []string{},
	}
	resp.Uids = l.svcCtx.SSE.GetUidByGroup(req.GroupId)
	return resp, nil
}
